<%@page import="blog.forms.User"%>
<%@page import="blog.controller.UserController"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %>

<%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<jsp:include page="cssChoose.jsp" />

<script type="text/javascript" src="js/validation.js"></script>

<title><%= "Ustawienia uzytkownika" %></title>
</head>
<body>
 	<div id = "container"> 	
 	<jsp:include page="header.jsp">
 		<jsp:param value="Blog!" name="title"/>
 	</jsp:include>
 	
	<div id="texts">
	<jsp:include page="menu.jsp"/>	

		<div id = "content">
		
			<% if(UserController.isLogged(session)) { %>	
					
				<% 
				
				User  u = UserController.getUser(session);
				   
				%>
				
				
			<form name = "settings" method = "post" action = "UserSettingsAction.do">
				
				<input type="hidden" name = "login" value = "<%= u.getLogin() %>" >		
				imie: <br/>
				<input type="text" name = "name" value = "<%= u.getName() %>" ><br/>
				<div id = "nameE" class = "error"> <%= ""  %> </div>
				nazwisko: <br/>
				<input type="text" name = "surname" value = "<%= u.getSurname() %>" ><br/>
				<div id = "surnameE" class = "error"> <%="" %> </div>
				mail: <br/>
				<input type="text" name = "mail" value = "<%= u.getMail() %>">
				<div id = "mailE" class = "error"> <html:errors property ="mailE"/> </div>
				o mnie: <br/>
				<textarea rows="5" cols="30" name = "description" ><%= u.getDescription() %></textarea> <br/>
				<div id = "desctiptionE" class = "error"> <%=""  %> </div>
				styl: <br/>
				<% if (u.getStyle().equals("css1") ){ %>
				<img src="images/css.jpeg"></img>  
				<INPUT TYPE="radio" NAME="style" VALUE="css1" CHECKED>
             		         		
            	<INPUT TYPE="radio" NAME="style" VALUE="css2">
             		<img src="images/css1.jpeg"></img> 
				<% } else {%>
				<img src="images/css.jpeg"></img> 
								<INPUT TYPE="radio" NAME="style" VALUE="css1" >
             		           		
            	<INPUT TYPE="radio" NAME="style" VALUE="css2" CHECKED>
             		<img src="images/css1.jpeg"></img> 
				<%} %>
				<br/>
				<button type = "submit">Zapisz</button>
				
			</form>
			
			<% } else { %>
				Zaloguj sie!
			<% } %>
			
</div>
	</div>
		<jsp:include page="../html/footer.html"/>
						

	</div>
	
</body>
</html>
